package com.minimalist.common.config.fileHandler.entity;

import jakarta.validation.constraints.NotBlank;
import java.util.Objects;

public class QiNiuFileEntity{

    @NotBlank(message = "访问密钥不能为空")
    private String accessKey;

    @NotBlank(message = "私有密钥不能为空")
    private String secretKey;

    @NotBlank(message = "桶名称不能为空")
    private String bucketName;

    @NotBlank(message = "域名不能为空")
    private String domain;

    @NotBlank(message = "七牛云存储区域ID不能为空")
    private String regionId;

    public String getAccessKey() {
        return accessKey;
    }

    public void setAccessKey(String accessKey) {
        this.accessKey = accessKey;
    }

    public String getSecretKey() {
        return secretKey;
    }

    public void setSecretKey(String secretKey) {
        this.secretKey = secretKey;
    }

    public String getDomain() {
        return domain;
    }

    public void setDomain(String domain) {
        this.domain = domain;
    }

    public String getBucketName() {
        return bucketName;
    }

    public void setBucketName(String bucketName) {
        this.bucketName = bucketName;
    }

    public String getRegionId() {
        return regionId;
    }

    public void setRegionId(String regionId) {
        this.regionId = regionId;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;
        QiNiuFileEntity that = (QiNiuFileEntity) o;
        return Objects.equals(accessKey, that.accessKey) &&
                Objects.equals(secretKey, that.secretKey) &&
                Objects.equals(domain, that.domain) &&
                Objects.equals(bucketName, that.bucketName) &&
                Objects.equals(regionId, that.regionId);
    }

    @Override
    public int hashCode() {
        return Objects.hash(accessKey, secretKey, domain, bucketName, regionId);
    }

    @Override
    public String toString() {
        return "QiNiuFileEntity{" +
                "accessKey='" + accessKey + '\'' +
                ", secretKey='" + secretKey + '\'' +
                ", domain='" + domain + '\'' +
                ", bucketName='" + bucketName + '\'' +
                ", regionId='" + regionId + '\'' +
                '}';
    }
}
